package com.itjyyang.hello;

public class HelloWorld {

    // 生成随机验证码并返回
    public static String getRandomCode() {
        String code = "";
        for (int i = 0; i < 4; i++) {
            int number = (int) (Math.random() * 10);
            code += number;
        }
        return code;
    }
    public static void main(String[] args) {
        String code = getRandomCode();
        System.out.println("验证码：" + code);
    }
}
